<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<jsp:useBean id="utilities" class="masterpiece.util.Utilities" scope="session" />    
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add New Article</title>
<link rel="stylesheet" type="text/css" href="css/default.css" />
</head>
<body>
<%@ include file="top_menu.jsp" %>
<%
String ePass = (request.getParameter("ePass"));
String headline = (request.getParameter("headline"));
String sub_headline = (request.getParameter("subheadline"));
java.sql.Date article_date = new java.sql.Date(System.currentTimeMillis());
int tempSection = (Integer.parseInt(request.getParameter("section")));
String section = "";
section += tempSection;
String body = (request.getParameter("body"));
java.sql.Date issue = (java.sql.Date.valueOf(request.getParameter("issue")));

try{
utilities.submitArticle(ePass, headline, sub_headline, article_date, section, body, issue);
out.println("<p class=\"message success\">"+ headline + " has been added succesfully</p>");
}catch(Exception e){
	out.println("<p class=\"message error\">ERROR</p>");
}
%>
</body>
</html>